gdkwindow: Specify some invariants for cursors
authorJasper St. Pierre <jstpierre@mecheye.net>
Tue, 28 Oct 2014 04:18:15 +0000 (21:18 -0700)
committerJasper St. Pierre <jstpierre@mecheye.net>
Tue, 28 Oct 2014 04:22:31 +0000 (21:22 -0700)
Cursors should not be on a different display than their window /
device, as that would break Wayland.

gdk/gdkwindow.c

index c0186aa74f87293a1a64c46e2144c1f515462ab9..1f05aff3ef5cbc350140c4ff94c26cd4b63fb9ad 100644 (file)
@@ -6015,6 +6015,9 @@ gdk_window_set_cursor_internal (GdkWindow *window,
   if (GDK_WINDOW_DESTROYED (window))
     return;
 
+  g_assert (gdk_window_get_display (window) == gdk_device_get_display (device));
+  g_assert (!cursor || gdk_window_get_display (window) == gdk_cursor_get_display (cursor));
+
   if (window->window_type == GDK_WINDOW_ROOT ||
       window->window_type == GDK_WINDOW_FOREIGN)
     GDK_WINDOW_IMPL_GET_CLASS (window->impl)->set_device_cursor (window, device, cursor);